<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Panel Plugin Register Macros: xfce4-panel Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="xfce4-panel Reference Manual">
<link rel="up" href="libxfce4panel-plugins.html" title="Part II. Panel Plugins">
<link rel="prev" href="XfcePanelPlugin.html" title="XfcePanelPlugin">
<link rel="next" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html" title="GObject Oriented Panel Plugin Registers Macros">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libxfce4panel-Panel-Plugin-Register-Macros.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libxfce4panel-plugins.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="XfcePanelPlugin.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libxfce4panel-Panel-Plugin-Register-Macros"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libxfce4panel-Panel-Plugin-Register-Macros.top_of_page"></a>Panel Plugin Register Macros</span></h2>
<p>Panel Plugin Register Macros — Register panel plugins that are compiled as modules.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libxfce4panel-Panel-Plugin-Register-Macros.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginCheck" title="XfcePanelPluginCheck ()">*XfcePanelPluginCheck</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginFunc" title="XfcePanelPluginFunc ()">*XfcePanelPluginFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginPreInit" title="XfcePanelPluginPreInit ()">*XfcePanelPluginPreInit</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XFCE-PANEL-PLUGIN-REGISTER:CAPS" title="XFCE_PANEL_PLUGIN_REGISTER()">XFCE_PANEL_PLUGIN_REGISTER</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XFCE-PANEL-PLUGIN-REGISTER-WITH-CHECK:CAPS" title="XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK()">XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XFCE-PANEL-PLUGIN-REGISTER-FULL:CAPS" title="XFCE_PANEL_PLUGIN_REGISTER_FULL()">XFCE_PANEL_PLUGIN_REGISTER_FULL</a><span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libxfce4panel-Panel-Plugin-Register-Macros.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;libxfce4panel/libxfce4panel.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="libxfce4panel-Panel-Plugin-Register-Macros.description"></a><h2>Description</h2>
<p>Macros to register panel plugins that are compiled as modules. Internal or
external is defined by the boolean key <code class="varname">X-XFCE-Internal</code>
in the plugin's .desktop file.</p>
</div>
<div class="refsect1">
<a name="libxfce4panel-Panel-Plugin-Register-Macros.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="XfcePanelPluginCheck"></a><h3>XfcePanelPluginCheck ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="c_punctuation">(</span>*XfcePanelPluginCheck<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gdk3/GdkScreen.html#GdkScreen-struct"><span class="type">GdkScreen</span></a> *screen</code></em>);</pre>
<p>Callback function that is run before creating a plugin. It should return
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the plugin is not available for whatever reason. The function
can be given as argument to one of the registration macros.</p>
<div class="refsect3">
<a name="XfcePanelPluginCheck.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>screen</p></td>
<td class="parameter_description"><p>the <a href="/usr/share/gtk-doc/html/gdk3/GdkScreen.html#GdkScreen-struct"><span class="type">GdkScreen</span></a> the panel is running on</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="XfcePanelPluginCheck.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the plugin can be started, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="XfcePanelPluginFunc"></a><h3>XfcePanelPluginFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*XfcePanelPluginFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="XfcePanelPlugin.html" title="XfcePanelPlugin"><span class="type">XfcePanelPlugin</span></a> *plugin</code></em>);</pre>
<p>Callback function to create the plugin contents. It should be given as
the argument to the registration macros.</p>
<div class="refsect3">
<a name="XfcePanelPluginFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>plugin</p></td>
<td class="parameter_description"><p>an <a class="link" href="XfcePanelPlugin.html" title="XfcePanelPlugin"><span class="type">XfcePanelPlugin</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="XfcePanelPluginPreInit"></a><h3>XfcePanelPluginPreInit ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
<span class="c_punctuation">(</span>*XfcePanelPluginPreInit<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> argc</code></em>,
                           <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **argv</code></em>);</pre>
<p>Callback function that is run in an external plugin before <a href="/usr/share/gtk-doc/html/gtk3/gtk3-General.html#gtk-init"><code class="function">gtk_init()</code></a>. It
should return <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the plugin is not available for whatever reason.
The function can be given as argument to one of the registration macros.</p>
<p>The main purpose of this callback is to allow multithreaded plugins to call
<a href="/usr/share/gtk-doc/html/glib/glib-Deprecated-Thread-APIs.html#g-thread-init"><code class="function">g_thread_init()</code></a>.</p>
<div class="refsect3">
<a name="XfcePanelPluginPreInit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>argc</p></td>
<td class="parameter_description"><p>number of arguments to the plugin</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>argv</p></td>
<td class="parameter_description"><p>argument array</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="XfcePanelPluginPreInit.returns"></a><h4>Returns</h4>
<p> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-4-6.html#api-index-4.6">4.6</a></p>
</div>
<hr>
<div class="refsect2">
<a name="XFCE-PANEL-PLUGIN-REGISTER:CAPS"></a><h3>XFCE_PANEL_PLUGIN_REGISTER()</h3>
<pre class="programlisting">#define             XFCE_PANEL_PLUGIN_REGISTER(construct_func)</pre>
<p>Register a panel plugin using a construct function. This is the
simplest way to register a panel plugin.
The <em class="parameter"><code>construct_func</code></em>
 is called everytime a plugin is created.</p>
<div class="refsect3">
<a name="XFCE-PANEL-PLUGIN-REGISTER.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>construct_func</p></td>
<td class="parameter_description"><p>name of the function that points to an
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginFunc" title="XfcePanelPluginFunc ()"><span class="type">XfcePanelPluginFunc</span></a> function.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-8.html#api-index-4.8">4.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="XFCE-PANEL-PLUGIN-REGISTER-WITH-CHECK:CAPS"></a><h3>XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK()</h3>
<pre class="programlisting">#define             XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK(construct_func, check_func)</pre>
<p>Register a panel plugin using a construct function. The <em class="parameter"><code>check_func</code></em>

will be called before the plugin is created. If this function returns
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, the plugin won't be added to the panel. For proper feedback,
you are responsible for showing a dialog why the plugin is not added
to the panel.</p>
<div class="refsect3">
<a name="XFCE-PANEL-PLUGIN-REGISTER-WITH-CHECK.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>construct_func</p></td>
<td class="parameter_description"><p>name of the function that points to an
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginFunc" title="XfcePanelPluginFunc ()"><span class="type">XfcePanelPluginFunc</span></a> function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>check_func</p></td>
<td class="parameter_description"><p>name of the function that points to an
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginCheck" title="XfcePanelPluginCheck ()"><span class="type">XfcePanelPluginCheck</span></a> function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-8.html#api-index-4.8">4.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="XFCE-PANEL-PLUGIN-REGISTER-FULL:CAPS"></a><h3>XFCE_PANEL_PLUGIN_REGISTER_FULL()</h3>
<pre class="programlisting">#define             XFCE_PANEL_PLUGIN_REGISTER_FULL(construct_func, preinit_func, check_func)</pre>
<p>Same as calling <a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-PREINIT-FUNC:CAPS" title="XFCE_PANEL_DEFINE_PREINIT_FUNC()"><span class="type">XFCE_PANEL_DEFINE_PREINIT_FUNC</span></a> and
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XFCE-PANEL-PLUGIN-REGISTER-WITH-CHECK:CAPS" title="XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK()"><span class="type">XFCE_PANEL_PLUGIN_REGISTER_WITH_CHECK</span></a>. See those macros
for more information.</p>
<div class="refsect3">
<a name="XFCE-PANEL-PLUGIN-REGISTER-FULL.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>construct_func</p></td>
<td class="parameter_description"><p>name of the function that points to an
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginFunc" title="XfcePanelPluginFunc ()"><span class="type">XfcePanelPluginFunc</span></a> function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>preinit_func</p></td>
<td class="parameter_description"><p>name of the function that points to an
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginPreInit" title="XfcePanelPluginPreInit ()"><span class="type">XfcePanelPluginPreInit</span></a> function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>check_func</p></td>
<td class="parameter_description"><p>name of the function that points to an
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginCheck" title="XfcePanelPluginCheck ()"><span class="type">XfcePanelPluginCheck</span></a> function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-8.html#api-index-4.8">4.8</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>